package com.code.day17JiHe.Fangfay;


import java.util.function.Supplier;

public class Demo02 {
    public static void main(String[] args) {

        method(new Supplier<Double>() {
            @Override
            public Double get() {
                return Math.random();
            }
        });
        method(Math::random);
    }
    public  static void  method(Supplier<Double> supplier){
        Double d = supplier.get();
        System.out.println("d ="+d);
    }
}
